package wraps

import (
	"github.com/gin-gonic/gin"
	"net/http"
	"wzpsoso.com/w/t1/models"
	w_tool "wzpsoso.com/w/t1/tools"
)

const sqlSTD = "select ID,TABLE_NAME,TABLE_CYCLE,TABLE_LAYER,ALARM_TIPS,to_char(TABLE_TIME,'yyyy-MM-dd hh24:mi:ss') from platform_alarm"

const sql_STD = "select ID,TABLE_NAME,TABLE_CYCLE,TABLE_LAYER,ALARM_TIPS,to_char(TABLE_TIME,'yyyy-MM-dd hh24:mi:ss') from platform_alarm"

func Demo(c *gin.Context) {
	//c.JSON(http.StatusOK, w_tool.SQL_query(w_tool.Lucky_DB, sql_STD))
	var a models.Result
	a.SelectTable = sql_STD
	a.Result = w_tool.SQL_query_O(w_tool.Lucky_DB, sql_STD).(*[]models.Platform_alarm)
	c.JSON(http.StatusOK, a)
}
